### ubuntu安装skype
    #!/bin/bash
    :<<!
     脚本用来在ubutu中安装 'Skype For Linux Alpha'.
    !
    echo "
     ************************************************************
     ****         will be installed skypeforlinux            ****
     ************************************************************
    "
    
    #权限检查
    if [ `id -u` -gt 0 ];
      then 
        echo 'please use  the root user to execute this script';
        exit 2;
    fi
    #变量设置
    basepath=$(cd `dirname $0`; pwd); #获取当前的绝对路径
    download_uri=https://go.skype.com/
    application_name=skypeforlinux
    file_name=skypeforlinux-64
    file_suffix=-alpha.deb
    exist=0;
    #校验是否已经安装了该软件
    existing_path=$(which $application_name)
    if [ -n $existing_path  ];
      then
        echo -e "The current system already contains $application_name software,are you sure re-install it?\n";
        echo -e "The path is:   $existing_path\n";
        echo -e "Enter yes(re-install) or no(stop)!"
        read -p "[yse/no]:" agree;
        if [ $agree != "yes"  ]
          then exit 0;
        fi
    fi
    echo $?
    #讀寫權限檢查
    if [ ! -w $basepath  ]
      then
        echo "current user does not havae write permission!";
      exit 2;
    fi
    #文件校驗
    for file in ls $basepath
      do
        if [[ $file =~ $file_name ]]
         then
           exist=1;
        fi
    done
    
    if [ 1 -eq $exist  ]
      then
        echo "file is already exists!"
        read -p "continue to install!?(yes/no)" next;
        if [ "yes"! = "$next"]
          then
            exit 2;
        fi
    fi
    #安装gdebi
    apt-get install gdebi
    
    wget $download_uri$file_name$file_suffix
    
    gdebi $file_name$file_suffix
    
    if [ 0 -lt  $? ]
      then
        exit $?
    fi
    if [ -d "$basepath" && -f "$basepath$file_name$file_suffix"  ]
      then 
        echo "安裝成功,刪除下載的臨時文件!"
        rm -rf $basepath/$file_name
    fi
